/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.hidden {
    display: none !important;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: white;
    margin-top: 20px;
    font-size: 1.2em;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
}

/* 导航样式 */
nav {
    background-color: #34495e;
    padding: 0;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
}

nav li {
    margin: 0 15px;
}

nav a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: #2c3e50;
}

/* 主体内容 */
main {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.screen {
    padding: 20px;
}

/* 欢迎界面 */
#welcome {
    text-align: center;
}

#welcome h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #2c3e50;
}

#welcome p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.welcome-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

#welcome button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    min-width: 150px;
}

#welcome button:hover {
    background-color: #2980b9;
}

#start-exam {
    background-color: #e74c3c;
}

#start-exam:hover {
    background-color: #c0392b;
}

/* 模拟考试设置界面 */
#exam-setup {
    text-align: center;
}

#exam-setup h2 {
    color: #2c3e50;
    margin-bottom: 30px;
}

.exam-settings {
    max-width: 400px;
    margin: 0 auto 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.setting-item label {
    font-weight: bold;
    color: #2c3e50;
}

.setting-item select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: white;
    min-width: 120px;
}

.exam-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.exam-actions button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s;
}

#start-exam-confirm {
    background-color: #e74c3c;
    color: white;
}

#start-exam-confirm:hover {
    background-color: #c0392b;
}

#back-to-welcome {
    background-color: #95a5a6;
    color: white;
}

#back-to-welcome:hover {
    background-color: #7f8c8d;
}

/* 题目界面 */
.question-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    color: #7f8c8d;
}

.exam-timer {
    color: #e74c3c;
    font-weight: bold;
    background-color: #fadbd8;
    padding: 5px 10px;
    border-radius: 3px;
    border: 1px solid #e74c3c;
}

/* 进度条 */
.progress-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background-color: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #3498db;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-weight: bold;
    color: #2c3e50;
    min-width: 40px;
}

.question-content {
    margin-bottom: 30px;
}

#question-text {
    font-size: 1.3em;
    margin-bottom: 20px;
    line-height: 1.8;
}

.question-image {
    text-align: center;
    margin: 20px 0;
}

.question-image-content {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s;
}

.question-image-content:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.image-loading {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-style: italic;
}

.image-error {
    text-align: center;
    padding: 20px;
    background-color: #fadbd8;
    border: 1px solid #e74c3c;
    border-radius: 5px;
    color: #e74c3c;
}

.image-error button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 10px;
}

/* 图片模态框样式 */
.image-modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background-color: white;
    border-radius: 5px;
    padding: 20px;
}

.image-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.image-modal-close:hover {
    color: #000;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
}

.option {
    display: block;
    margin: 10px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.option:hover {
    background-color: #f8f9fa;
    border-color: #3498db;
}

.option.selected {
    background-color: #d6eaf8;
    border-color: #3498db;
}

.option.correct {
    background-color: #d5f5e3;
    border-color: #27ae60;
}

.option.incorrect {
    background-color: #fadbd8;
    border-color: #e74c3c;
}

.question-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.question-actions button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

#prev-btn {
    background-color: #95a5a6;
    color: white;
}

#prev-btn:hover {
    background-color: #7f8c8d;
}

#next-btn, #submit-btn {
    background-color: #3498db;
    color: white;
}

#next-btn:hover, #submit-btn:hover {
    background-color: #2980b9;
}

.submit-exam-btn {
    background-color: #e74c3c;
    color: white;
}

.submit-exam-btn:hover {
    background-color: #c0392b;
}

/* 结果界面 */
#result-screen h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

.exam-result-summary {
    text-align: center;
    margin-bottom: 30px;
}

.exam-result-summary h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.result-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.result-message {
    font-size: 1.2em;
    font-weight: bold;
    padding: 15px;
    border-radius: 5px;
    background-color: #d5f5e3;
    color: #27ae60;
    border: 1px solid #27ae60;
}

.result-item {
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
    border-left: 5px solid #3498db;
    background-color: #f8f9fa;
}

.result-item.wrong {
    border-left-color: #e74c3c;
    background-color: #fadbd8;
}

.result-item .question-text {
    font-weight: bold;
    margin-bottom: 10px;
}

.result-item .user-answer {
    color: #e74c3c;
    margin: 5px 0;
}

.result-item .correct-answer {
    color: #27ae60;
    margin: 5px 0;
}

.result-item .explanation {
    margin-top: 10px;
    padding: 10px;
    background-color: white;
    border-radius: 3px;
}

#result-screen button {
    display: block;
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s;
}

#review-wrong {
    background-color: #e74c3c;
    color: white;
}

#review-wrong:hover {
    background-color: #c0392b;
}

#restart-btn {
    background-color: #3498db;
    color: white;
}

#restart-btn:hover {
    background-color: #2980b9;
}

/* 导入界面 */
#import-screen h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

.question-bank-section, .import-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f8f9fa;
}

.question-bank-section h3, .import-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.question-banks-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.question-bank-item {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.question-bank-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.2);
}

.question-bank-item.active {
    border-color: #27ae60;
    background-color: #d5f5e3;
}

.question-bank-name {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.question-bank-info {
    font-size: 0.9em;
    color: #7f8c8d;
}

.bank-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.refresh-btn {
    background-color: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.refresh-btn:hover {
    background-color: #7f8c8d;
}

.delete-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.delete-btn:hover:not(:disabled) {
    background-color: #c0392b;
}

.delete-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.rename-btn {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.rename-btn:hover:not(:disabled) {
    background-color: #e67e22;
}

.rename-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.import-options {
    margin-bottom: 15px;
}

.import-options label {
    display: inline-block;
    margin-right: 20px;
    cursor: pointer;
}

.import-options input[type="radio"] {
    margin-right: 5px;
}

#import-text {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    font-size: 1em;
    resize: vertical;
    margin-bottom: 15px;
}

.import-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

#import-submit {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#import-submit:hover {
    background-color: #229954;
}

.secondary-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.secondary-btn:hover {
    background-color: #2980b9;
}

#import-result {
    padding: 15px;
    border-radius: 5px;
    text-align: center;
}

#import-result.success {
    background-color: #d5f5e3;
    color: #27ae60;
    border: 1px solid #27ae60;
}

#import-result.error {
    background-color: #fadbd8;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

#import-result.info {
    background-color: #d6eaf8;
    color: #2980b9;
    border: 1px solid #2980b9;
}

/* 数据管理区域 */
.data-management-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f8f9fa;
}

.data-management-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.data-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.export-all-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.export-all-btn:hover {
    background-color: #229954;
}

.import-all-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.import-all-btn:hover {
    background-color: #2980b9;
}

.clear-all-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.clear-all-btn:hover {
    background-color: #c0392b;
}

/* 错题本界面 */
#wrong-book {
    padding: 20px;
}

#wrong-book h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

.wrong-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9em;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
    color: #2c3e50;
}

.wrong-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.practice-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

.practice-btn:hover {
    background-color: #229954;
}

.clear-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

.clear-btn:hover {
    background-color: #c0392b;
}

.export-btn {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

.export-btn:hover {
    background-color: #e67e22;
}

.wrong-question-item {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f8f9fa;
}

.wrong-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.wrong-question-title {
    font-weight: bold;
    color: #2c3e50;
}

.wrong-question-actions {
    display: flex;
    gap: 5px;
}

.wrong-question-actions button {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
}

.review-btn {
    background-color: #3498db;
    color: white;
}

.review-btn:hover {
    background-color: #2980b9;
}

.remove-btn {
    background-color: #e74c3c;
    color: white;
}

.remove-btn:hover {
    background-color: #c0392b;
}

.wrong-question-content {
    margin-bottom: 15px;
}

.wrong-answer-info {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.wrong-user-answer {
    color: #e74c3c;
    font-weight: bold;
}

.wrong-correct-answer {
    color: #27ae60;
    font-weight: bold;
}

.wrong-explanation {
    background-color: white;
    padding: 15px;
    border-radius: 3px;
    border-left: 4px solid #3498db;
}

#wrong-book #back-to-main {
    display: block;
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s;
    background-color: #3498db;
    color: white;
}

#wrong-book #back-to-main:hover {
    background-color: #2980b9;
}

/* 底部样式 */
footer {
    text-align: center;
    padding: 20px 0;
    background-color: #ecf0f1;
    color: #7f8c8d;
    margin-top: 30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
    }
    
    nav li {
        margin: 5px 0;
    }
    
    .question-actions {
        flex-direction: column;
    }
    
    .question-actions button {
        margin: 5px 0;
    }
    
    .question-info {
        flex-direction: column;
        text-align: center;
    }
}